package com.lucnn.diamond.spring.config;

import com.lucnn.diamond.spring.bean.BenzCar;
import com.lucnn.diamond.spring.bean.Engine;
import com.lucnn.diamond.spring.bean.SpecialBeanForEngine;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class BeanFactoryPostProcessConfig {

    @Bean
    SpecialBeanForEngine specialBeanForEngine(){
        return new SpecialBeanForEngine();
    }

    @Bean(initMethod="start")
    BenzCar benzCar(Engine engine){
        BenzCar car = new BenzCar();
        car.engine = engine;
        return car ;
    }
}
